Telegram Group & Telegram Channel
πŸ‘£ Как ΠΎΠ΄Π½ΠΎΠΉ Go‑слуТбС Π»Π΅Π³ΠΊΠΎ Π²Ρ‹Π΄Π΅Ρ€ΠΆΠ°Ρ‚ΡŒ 200000 RPS Π½Π° ΠΎΠ΄Π½ΠΎΠΉ машинС

Π’ свСТСй ΡΡ‚Π°Ρ‚ΡŒΠ΅ Никиты Π‘ΡƒΡ€ΠΎΠ²Π° разбираСтся практичСский кСйс: Π±Π΅Π· ΡˆΠ°Ρ€Π΄ΠΈΡ€ΠΎΠ²Π°Π½ΠΈΡ, Π±Π΅Π· дСсятков Ρ€Π΅ΠΏΠ»ΠΈΠΊ ΠΈ Π±Π΅Π· ΠΌΠ°Π³ΠΈΠΈ ΠΎΠ±Π»Π°ΠΊΠ° β€” всСго Π·Π° счёт ΠΏΡ€Π°Π²ΠΈΠ»ΡŒΠ½Ρ‹Ρ… ΠΎΠΏΡ‚ΠΈΠΌΠΈΠ·Π°Ρ†ΠΈΠΉ Go‑сСрвис Π½Π° ΠΎΠ΄Π½ΠΎΠΌ MacBook Pro M3 достигаСт 200000 запросов Π² сСкунду с ΠΌΠ΅Π΄ΠΈΠ°Π½Π½Ρ‹ΠΌ P50 < 1 мс. Π’ΠΎΡ‚ Π³Π»Π°Π²Π½Ρ‹Π΅ ΠΏΡ€ΠΈΡ‘ΠΌΡ‹:

1⃣ Π‘Π²ΠΎΠ΄ΠΈΠΌ Ρ€Π°Π±ΠΎΡ‚Ρƒ «горячСго» ΠΏΡƒΡ‚ΠΈ ΠΊ ΠΌΠΈΠ½ΠΈΠΌΡƒΠΌΡƒ
- Π‘татичСский ΠΏΡ€Π΅ΠΏΠΎΠ΄Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½Π½Ρ‹ΠΉ Ρ„ΠΈΠ΄ β€” ΠΈΠ· памяти, Π±Π΅Π· Π‘Π”/API.
- ΠΠΎΠ»ΡŒ Π°Π»Π»ΠΎΠΊΠ°Ρ†ΠΈΠΉ β€” Π½ΠΈΠΊΠ°ΠΊΠΈΡ… new/make Π² горячСм ΠΏΡƒΡ‚ΠΈ.

2⃣ net/http β†’ fasthttp
- Π‘ыстрСС TCP, Π±ΡƒΡ„Π΅Ρ€Ρ‹, Π·Π°Π³ΠΎΠ»ΠΎΠ²ΠΊΠΈ.
- Γ—8–10 прирост RPS.

3⃣ Pool ΠΎΠ±ΡŠΠ΅ΠΊΡ‚ΠΎΠ² + явный сброс
- sync.Pool для структур.
- ΠžΡ‚ΠΊΠ°Π· ΠΎΡ‚ defer.

4⃣ Tюнинг GOMAXPROCS + GOGC
- GOMAXPROCS= ядра.
- GOGC=200–300.

5⃣ ΠŸΡ€ΠΎΡ„ΠΈΠ»ΠΈΡ€ΠΎΠ²Π°Π½ΠΈΠ΅ pprof benchstat

Π Π΅Π·ΡƒΠ»ΡŒΡ‚Π°Ρ‚: ΠΎΠ΄ΠΈΠ½ инстанс Π΄Π΅Ρ€ΠΆΠΈΡ‚ 200000 RPS с P50 < 1мс ΠΈ P99 < 2мс.

πŸ”— Полная ΡΡ‚Π°Ρ‚ΡŒΡ: https://medium.com/@nikitaburov/how-to-easily-handle-200k-rps-with-golang-8b62967a01dd
Please open Telegram to view this post
VIEW IN TELEGRAM



tg-me.com/golang_books/960
Create:
Last Update:

πŸ‘£ Как ΠΎΠ΄Π½ΠΎΠΉ Go‑слуТбС Π»Π΅Π³ΠΊΠΎ Π²Ρ‹Π΄Π΅Ρ€ΠΆΠ°Ρ‚ΡŒ 200000 RPS Π½Π° ΠΎΠ΄Π½ΠΎΠΉ машинС

Π’ свСТСй ΡΡ‚Π°Ρ‚ΡŒΠ΅ Никиты Π‘ΡƒΡ€ΠΎΠ²Π° разбираСтся практичСский кСйс: Π±Π΅Π· ΡˆΠ°Ρ€Π΄ΠΈΡ€ΠΎΠ²Π°Π½ΠΈΡ, Π±Π΅Π· дСсятков Ρ€Π΅ΠΏΠ»ΠΈΠΊ ΠΈ Π±Π΅Π· ΠΌΠ°Π³ΠΈΠΈ ΠΎΠ±Π»Π°ΠΊΠ° β€” всСго Π·Π° счёт ΠΏΡ€Π°Π²ΠΈΠ»ΡŒΠ½Ρ‹Ρ… ΠΎΠΏΡ‚ΠΈΠΌΠΈΠ·Π°Ρ†ΠΈΠΉ Go‑сСрвис Π½Π° ΠΎΠ΄Π½ΠΎΠΌ MacBook Pro M3 достигаСт 200000 запросов Π² сСкунду с ΠΌΠ΅Π΄ΠΈΠ°Π½Π½Ρ‹ΠΌ P50 < 1 мс. Π’ΠΎΡ‚ Π³Π»Π°Π²Π½Ρ‹Π΅ ΠΏΡ€ΠΈΡ‘ΠΌΡ‹:

1⃣ Π‘Π²ΠΎΠ΄ΠΈΠΌ Ρ€Π°Π±ΠΎΡ‚Ρƒ «горячСго» ΠΏΡƒΡ‚ΠΈ ΠΊ ΠΌΠΈΠ½ΠΈΠΌΡƒΠΌΡƒ
- Π‘татичСский ΠΏΡ€Π΅ΠΏΠΎΠ΄Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½Π½Ρ‹ΠΉ Ρ„ΠΈΠ΄ β€” ΠΈΠ· памяти, Π±Π΅Π· Π‘Π”/API.
- ΠΠΎΠ»ΡŒ Π°Π»Π»ΠΎΠΊΠ°Ρ†ΠΈΠΉ β€” Π½ΠΈΠΊΠ°ΠΊΠΈΡ… new/make Π² горячСм ΠΏΡƒΡ‚ΠΈ.

2⃣ net/http β†’ fasthttp
- Π‘ыстрСС TCP, Π±ΡƒΡ„Π΅Ρ€Ρ‹, Π·Π°Π³ΠΎΠ»ΠΎΠ²ΠΊΠΈ.
- Γ—8–10 прирост RPS.

3⃣ Pool ΠΎΠ±ΡŠΠ΅ΠΊΡ‚ΠΎΠ² + явный сброс
- sync.Pool для структур.
- ΠžΡ‚ΠΊΠ°Π· ΠΎΡ‚ defer.

4⃣ Tюнинг GOMAXPROCS + GOGC
- GOMAXPROCS= ядра.
- GOGC=200–300.

5⃣ ΠŸΡ€ΠΎΡ„ΠΈΠ»ΠΈΡ€ΠΎΠ²Π°Π½ΠΈΠ΅ pprof benchstat

Π Π΅Π·ΡƒΠ»ΡŒΡ‚Π°Ρ‚: ΠΎΠ΄ΠΈΠ½ инстанс Π΄Π΅Ρ€ΠΆΠΈΡ‚ 200000 RPS с P50 < 1мс ΠΈ P99 < 2мс.

πŸ”— Полная ΡΡ‚Π°Ρ‚ΡŒΡ: https://medium.com/@nikitaburov/how-to-easily-handle-200k-rps-with-golang-8b62967a01dd

BY Golang Books




Share with your friend now:
tg-me.com/golang_books/960

View MORE
Open in Telegram


Golang Books Telegram | DID YOU KNOW?

Date: |

The Singapore stock market has alternated between positive and negative finishes through the last five trading days since the end of the two-day winning streak in which it had added more than a dozen points or 0.4 percent. The Straits Times Index now sits just above the 3,060-point plateau and it's likely to see a narrow trading range on Monday.

Telegram and Signal Havens for Right-Wing Extremists

Since the violent storming of Capitol Hill and subsequent ban of former U.S. President Donald Trump from Facebook and Twitter, the removal of Parler from Amazon’s servers, and the de-platforming of incendiary right-wing content, messaging services Telegram and Signal have seen a deluge of new users. In January alone, Telegram reported 90 million new accounts. Its founder, Pavel Durov, described this as β€œthe largest digital migration in human history.” Signal reportedly doubled its user base to 40 million people and became the most downloaded app in 70 countries. The two services rely on encryption to protect the privacy of user communication, which has made them popular with protesters seeking to conceal their identities against repressive governments in places like Belarus, Hong Kong, and Iran. But the same encryption technology has also made them a favored communication tool for criminals and terrorist groups, including al Qaeda and the Islamic State.

Golang Books from sg


Telegram Golang Books
FROM USA